<?php

namespace App\Models;

use Tymon\JWTAuth\Contracts\JWTSubject;
use Illuminate\Notifications\Notifiable;
use Illuminate\Foundation\Auth\User as Authenticatable;

class Users extends Authenticatable implements JWTSubject {
    use Notifiable;

    // 白名单
    protected $fillable = [
        'mobile', 'password',
    ];

    public function getJWTIdentifier() {
        // TODO: Implement getJWTIdentifier() method.
        return $this->getKey();
    }

    public function getJWTCustomClaims() {
        // TODO: Implement getJWTCustomClaims() method.
        return [];
    }

    function MUserInfo(){
        return $this->hasOne(UserInfo::class, 'user_id', 'id');
    }

    function MUserDetail(){
        return $this->hasOne(UserDetail::class, 'user_id', 'id');
    }

}
